<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Offset Calculator</title>
    <script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
</head>
<body>
<p>
    计算结果：<span id="final-offset">{{ final_offset }}</span> ms
    <button id="copy-offset" data-clipboard-target="#final-offset">复制结果</button>
</p>
<!--<button id="close-window" onclick="window.close()">关闭当前页面</button>-->

<script>
    var copyOffsetBtn = new ClipboardJS('#copy-offset');
    copyOffsetBtn.on('success', function (e) {
        alert('复制成功')
        e.clearSelection();
    });
    copyOffsetBtn.on('error', function (e) {
        alert('复制失败')
    });
</script>
</body>
</html>